﻿<ResourceDictionary x:Class="OpenLS.Spreadsheet.UI.Internals.WorkbookProtectionResources"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Internals="clr-namespace:OpenLS.Spreadsheet.UI.Internals"
                    xmlns:Resources="clr-namespace:OpenLS.Spreadsheet.UI.Internals.Resources">
    <DataTemplate DataType="{x:Type Internals:WorkbookProtectionViewModel}">
        <GroupBox Header="{x:Static Resources:UIStringTable.ProtectWorkbookFor}">
            <StackPanel>
                <CheckBox Content="{x:Static Resources:UIStringTable.Structure}" Margin="3" IsChecked="{Binding Structure}" Name="structure"></CheckBox>
                <CheckBox Content="{x:Static Resources:UIStringTable.Windows}" Margin="3" IsChecked="{Binding Windows}" Name="windows"></CheckBox>
                <TextBlock Text="{x:Static Resources:UIStringTable.PasswordOptional_}" Margin="0 5 0 0" Name="passwordHeader"></TextBlock>
                <TextBox Text="{Binding Password}" ></TextBox>
            </StackPanel>
        </GroupBox>
        <DataTemplate.Triggers>
            <DataTrigger Binding="{Binding HasProtection}" Value="True">
                <Setter TargetName="structure" Property="Visibility" Value="Collapsed"></Setter>
                <Setter TargetName="windows" Property="Visibility" Value="Collapsed"></Setter>
                <Setter TargetName="passwordHeader" Property="Visibility" Value="Collapsed"></Setter>
            </DataTrigger>
        </DataTemplate.Triggers>
    </DataTemplate>

</ResourceDictionary>
